import { createStore } from 'vuex'
import createPersistedstate from 'vuex-persistedstate'

export default createStore({
  state: {
     arr:[],
     num:'',
  },
  mutations: {
    sss(state,obj){
      state.arr.push(obj)
      console.log(state.arr);
    }
  },
  actions: {
  },
  modules: {
  },
  plugins: [
    //默认是存储在localStorage中
    createPersistedstate({
      // key: 存储数据的键名
      key: 'longStore',
      //paths:存储state中的那些数据
      paths: ['arr']
    })
  ]

})
